<!-- Modal -->
<#include "../../select.ftl" />
<div class="modal-dialog wide" style="width:610px;">
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">
            <#if tdMxb??>
                <#if tdMxb.id??>
                    编辑
                <#else>
                    新增
                </#if>
            </#if>
        </h4>
    </div>
    <div class="modal-body">
        <div id="errorMessage"><#include "../../message.ftl" /></div>
        <form class="form-horizontal" role="form" id="tdMxbForm" method="post" action="${absoluteContextPath}/td/tdMxb/save">
            <#if tdMxb??>
                <#if tdMxb.id??>
                    <input type="hidden" name="id" value="${tdMxb.id}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
            <div class="row">

            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">姓名</label>
                <div class="col-sm-8">
                    <input name="userName" value="${tdMxb.userName!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">录入日期</label>
                <div class="col-sm-8">
                    <input name="entryDate" value="${(tdMxb.entryDate?string("yyyy-MM-dd"))!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">早晚禅修</label>
                <div class="col-sm-8">
                    <input name="zwMeditation" value="${tdMxb.zwMeditation!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">本人运动</label>
                <div class="col-sm-8">
                    <input name="exercise" value="${tdMxb.exercise!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">健康饮食</label>
                <div class="col-sm-8">
                    <input name="eat" value="${tdMxb.eat!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">周三共修</label>
                <div class="col-sm-8">
                    <input name="medMeditation" value="${tdMxb.medMeditation!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">带动家人数量</label>
                <div class="col-sm-8">
                    <input name="rcNum" value="${tdMxb.rcNum!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">家人健康管理</label>
                <div class="col-sm-8">
                    <input name="healthManage" value="${tdMxb.healthManage!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">带动客户数量</label>
                <div class="col-sm-8">
                    <input name="khNum" value="${tdMxb.khNum!''}" type="text" class="form-control"/>
                </div>
            </div>
            <div class="form-group col-md-6">
                <label class="col-sm-4 control-label">客户健康管理</label>
                <div class="col-sm-8">
                    <input name="khManage" value="${tdMxb.khManage!''}" type="text" class="form-control"/>
                </div>
            </div>
                <div class="form-group col-md-6">
                    <label class="col-sm-4 control-label">类型</label>
                    <div class="col-sm-8">
                    <@select name="tdType" value="${tdMxb.tdType!''}" list=tdTypeList class="form-control"/>
                        <#--<input name="tdType" value="${tdMxb.tdType!''}" type="text" class="form-control"/>-->
                    </div>
                </div>
                   </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
        <button type="button" class="btn btn-primary" onclick="save();">保存</button>
    </div>
</div>
</div>
<script>
    function save() {
        $("#" + "tdMxbForm").ajaxSubmit({
            success:function(data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId:"showMessage",message:"信息保存成功！",type:"success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId:"errorMessage",message:"<strong>错误信息</strong>：" + data.returnMsg,type:"error"});
                }
            }
        });
    }

    $(function () {
        $("input[name=entryDate]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })
        $("div[class='tooltip fade top in']").hide();
    });
</script>